import Title from 'antd/lib/skeleton/Title';
import React, { Component } from 'react';
import { withRouter } from 'react-router';
import {SOneList} from "../../styled/index"
// import 
class oneList extends Component {
    constructor(props){
        super(props)

    }
    jumpDetails(id){
        // 同胞传值
        // PubSub.publish("chuanzhi",this.props.info);
        this.props.history.push({pathname:"/details"+"/"+id});
    }
    render() {
        let {id,kind,mainImg,price,title,color,detailsImg} = this.props.info;
        return (
            <SOneList>
            <div className="OneProduct" onClick={this.jumpDetails.bind(this,id)}>
                <img src={mainImg} alt="加载错误"/>
                <div className="info" >
                    <h4>{title+" "}</h4>
                    <p><span>{kind.split(",")[0]}</span><span>{color}</span>￥<b>{price}</b></p>
                    <button >查看更多</button>
                </div>
            </div>
            </SOneList>    
        )
    }
}
export default withRouter(oneList)
